# Maintainer: Bruno Pagani <archange@archlinux.org>

_pkg=distributed
pkgname=python-${_pkg}
pkgver=2022.12.1
pkgrel=3
pkgdesc="Distributed task scheduler for Dask"
arch=(loong64 x86_64)
url="https://distributed.dask.org/"
license=(BSD)
depends=(
    python
    python-click
    python-cloudpickle
    python-dask
    python-jinja
    python-msgpack
    python-packaging
    python-psutil
    python-sortedcontainers
    python-tblib
    python-toolz
    python-tornado
    python-urllib3
    python-yaml
    python-zict
)
makedepends=(python-setuptools)
checkdepends=(ipython
    python-pytest
    python-pytest-repeat
    python-pytest-timeout
    python-flaky
    python-blosc
    python-cryptography
    python-distributed
    python-fsspec
    python-h5py
    python-ipykernel
    python-ipywidgets
    python-jsonschema
    python-locket
    python-lz4
    python-netcdf4
    python-numpy
    python-pandas
    python-paramiko
    python-prometheus_client
    python-pyarrow
    python-pytorch
    python-requests
    python-scipy
    python-snappy
    python-zstandard
)
# No tests in PyPi tarballs
#source=(https://files.pythonhosted.org/packages/source/${_pkg::1}/${_pkg}/${_pkg}-${pkgver}.tar.gz)
source=(https://github.com/dask/distributed/archive/${pkgver}/${pkgname}-${pkgver}.tar.gz)
sha256sums=('9051cf8ea2a29e7737eb53a65f6689e3b20d7031f9eb326bb0aa66b48d7c18d2')

build() {
  cd ${_pkg}-${pkgver}
  python setup.py build
}

# Not collecting properly, no time to investigate
#check() {
#  cd ${_pkg}-${pkgver}
#  pytest -vvrsfE --color=yes distributed -m "not avoid_ci"
#}

package() {
  cd ${_pkg}-${pkgver}
  python setup.py install --prefix=/usr --root="${pkgdir}" --optimize=1 --skip-build
  install -Dm644 LICENSE.txt -t "${pkgdir}"/usr/share/licenses/${pkgname}/
}
